export default class Canvas {
    constructor(app) {
        this.app = app;
        this.options = this.app.options;
        this.el = this.element();
        this.box();
    }

    element() {
        let div = document.createElement('div');
        div.classList.add('app');
        let num = this.options.width / 50;
        div.style.gridTemplateColumns = `repeat(${num},50px)`;
        document.body.insertAdjacentElement('beforeEnd', div);
        return div;
    }

    box() {
        let num = (this.options.width * this.options.height) / 2500;
        for (let i = 0; i < num; i++) {
            let div = document.createElement('div');
            div.classList.add('box');
            this.el.insertAdjacentElement('beforeend', div);
        }
    }
}
